<template>
	<!-- <view class="content" style="background-size:cover;background-image: url(../../static/images/index.png);overflow:auto;height: 6500upx;width: 750upx;"> -->
	<!-- <view @click="canteen()" style="width: 50%; height: 300upx;margin-top: 490upx;"></view> -->
	<!-- <view style="width: 50%; height: 300upx; background-color: #0FAEFF;margin-top: 100upx;position: absolute;right: 30upx;margin-top: 850upx;">老年就医管</view>
		<view style="width: 45%; height: 250upx; background-color: #0FAEFF;margin-top: 100upx;right: 30upx;margin-top: 470upx;">老年学堂</view> -->
	<!-- </view> -->
	<view>
		<view class="position-relative">
			<view class="position-absolute col-7" @tap="canteen"
				style="z-index: 2;  margin-top: 580rpx;height: 330rpx;">

			</view>
			<view class="position-absolute col-6 right-0" @tap="hospital"
				style="z-index: 2; margin-top: 960rpx;height: 340rpx;">

			</view>

			<view @tap='school()' class="position-absolute col-6 " style="margin-top: 1400rpx;height: 340rpx;">

			</view>

			<view @tap='activity' class="position-absolute col-6 " style="margin-top: 1900rpx;height: 450rpx;right: 0rpx;">

			</view>

			<view class="position-absolute col-6 " style="margin-top: 2450rpx;height: 350rpx;">

			</view>

			<view class="position-absolute col-6 " style="margin-top: 2850rpx;height: 350rpx;right: 0;">

			</view>

			<view class="position-absolute col-6 " style="margin-top: 3350rpx;height: 350rpx;">

			</view>

			<view class="position-absolute col-6 " style="margin-top: 3900rpx;height: 350rpx;right: 40rpx;">

			</view>

			<view class="position-absolute col-7 " style="margin-top: 4450rpx;height: 450rpx;">

			</view>
			<view class="position-absolute col-7 " style="margin-top: 5100rpx;height: 450rpx;right: 20rpx;">

			</view>

			<view class="position-absolute col-6 " style="margin-top: 5700rpx;height: 450rpx;">

			</view>

			<image src="../../static/images/index.png" mode="widthFix">

			</image>
		</view>
		<!-- #ifdef APP-PLUS -->
		<luo-version-upgrade :version="release.version" :describe="release.describe==''? null : release.describe"
			:is_force="release.isForce == 1 ? true : false" :url="release.url" />
		<!-- #endif -->
	</view>

</template>


<script>
	import versionUpgrade from "@/components/luo-version-upgrade/luo-version-upgrade.vue";
	export default {
		components: {
			versionUpgrade
		},
		data() {
			return {
				release: {},
				longitude:'',
				latitude:''
			}
		},
		onLoad() {
			uni.getLocation({
				type:'gcj02',
				success: (res) => {
					console.log(res.longitude)
					console.log(res.latitude)
					this.longitude = res.longitude
					this.latitude = res.latitude
					}
				})
		},
		onShow() {
			//#ifdef APP-PLUS
				// this.checkUpdate() 
		    //#endif
		},
		methods: {
			getPlatform() {
				return uni.getSystemInfoSync().platform.toLowerCase();
			},
			checkUpdate() {
				let platform = this.getPlatform()
				console.log(platform)
				plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
					//  获取 app的version
					let appversion = wgtinfo.version;
					// 存缓存 版本号
					try {
						uni.setStorageSync('appversion', appversion);
					} catch (e) {}
					console.log("appversion:" + appversion);
				});
				let parameter = {
					platform: ''
				}
				if ('android' == platform) {
					parameter.platform = 2
					this.$api.lastRelease(parameter).then((res) => {
						this.release = res.data.dataMap
					})
					return
				} else if ('ios' == platform) {
					parameter.platform = 1
					this.$api.lastRelease(parameter).then((res) => {
						this.release = res.data.dataMap
					})
				}


			},
			canteen() {
				uni.setStorageSync('classifyId', 1);
				uni.setStorageSync('className', "老年食堂");
				uni.reLaunch({
					url: '/pages/shopList/shopList?longitude='+this.longitude+'&latitude='+this.latitude
				})


			},
			hospital() {
				uni.setStorageSync('classifyId', 2);
				uni.setStorageSync('className', "老年就医");
				uni.reLaunch({
					url: '/pages/shopList/shopList?longitude='+this.longitude+'&latitude='+this.latitude
				})
			},
			school() {
				uni.setStorageSync('classifyId', 3);
				uni.setStorageSync('className', "老年学堂");
				uni.reLaunch({
					url: '/pages/shopList/shopList?longitude='+this.longitude+'&latitude='+this.latitude
				})
			},
			activity() {
				uni.setStorageSync('classifyId', 4);
				uni.setStorageSync('className', "活动中心");
				uni.reLaunch({
					url: '/pages/shopList/shopList?longitude='+this.longitude+'&latitude='+this.latitude
				})
				// uni.reLaunch({
				// 	url: '/pages/shopList/shopList?longitude='+this.longitude+'&latitude='+this.latitude
				// })
			}

		}

	}
</script>

<style>
	.position-relative view {
		/* background-color: #007AFF; */
		z-index: 2;
	}

	.hello {
		display: flex;
		flex: 1;
		flex-direction: column;
	}

	.title {
		color: #8f8f94;
		margin-top: 25px;
	}

	.ul {
		font-size: 15px;
		color: #8f8f94;
		margin-top: 25px;
	}

	.ul>view {
		line-height: 25px;
	}
</style>
